package com.yxw.job.task;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yxw.yxnet_cd_center.common.utils.BaseDateTime;
import com.yxw.job.feign.client.CustomServiceFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 消息管理定时任务类
 * liuxin
 * 2023.09.22
 */
@Component
@Slf4j
public class NoticeTask {

    @Autowired
    private CustomServiceFeignClient customServiceFeignClient;

    /**
     * 客服接待客户数统计（群维度）
     *
     * @param str
     * @return
     */
    @XxlJob("chatStatisticsHandler")
    public ReturnT<String> execChatStatisticsHandler(String str) {
        log.info("---------客服接待客户数统计（群维度）开始--------" + BaseDateTime.getLongDateTimeString(new Date()));
        customServiceFeignClient.execChatStatistics();
        log.info("---------客服接待客户数统计（群维度）结束--------" + BaseDateTime.getLongDateTimeString(new Date()));
        return ReturnT.SUCCESS;
    }
}
